<!-- 当前导航 -->
<div class="current-position">
  <!-- 面包屑 -->
  <nz-breadcrumb class="breadcrumb">
    <nz-breadcrumb-item>首页</nz-breadcrumb-item>
    <nz-breadcrumb-item>用户管理</nz-breadcrumb-item>
    <nz-breadcrumb-item>用户注册</nz-breadcrumb-item>
  </nz-breadcrumb>
  <h1 class="current-position-title">app授权</h1>
  <h1 class="current-position-desc">app授权管理，给用户分配app的权限</h1>
  <div class="steps" *ngIf="_isReg">
    <nz-steps [(nzCurrent)]="_currentStep">
      <nz-step [nzTitle]="'用户注册'" [nzDescription]="'填写用户资料.'"></nz-step>
      <nz-step [nzTitle]="'app授权'" [nzDescription]="'授权分配.'"></nz-step>
    </nz-steps>
  </div>
</div>
<!-- 主体内容 -->
<div class="main-content">
  <div style="margin-bottom: 10px;">
    <button nz-button [disabled]="_disabledButton" [nzType]="'primary'" [nzLoading]="_loadingData" (click)="updateAuthorized()">更新配置</button>
  </div>
  <nz-table #nzTable [nzDataSource]="_appLs" [(nzPageIndex)]="_currentPageIndex" [nzShowTotal]="true" [nzScroll]="{ y: 450 }"
    [nzIsPagination]="false">
    <ng-template #nzFixedHeader>
      <thead nz-thead>
        <tr>
          <th nz-th nzCheckbox>
            <label nz-checkbox [(ngModel)]="_allChecked" [nzIndeterminate]="_indeterminate" (ngModelChange)="checkAll($event)">
            </label>
          </th>
          <th nz-th [nzWidth]="'40%'">
            <span>appName</span>
          </th>
          <th nz-th [nzWidth]="'40%'">
            <span>appId</span>
          </th>
          <th nz-th>
            <span>授权状态</span>
          </th>
        </tr>
      </thead>
    </ng-template>
    <tbody nz-tbody>
      <tr nz-tbody-tr *ngFor="let data of nzTable.data; let i = index">
        <td nz-td nzCheckbox>
          <label nz-checkbox [(ngModel)]="data.checked" (ngModelChange)="refreshStatus($event)">
          </label>
        </td>
        <td nz-td>
          <a>{{data.AppName}}</a>
        </td>
        <td nz-td>{{data.AppId}}</td>
        <td nz-td>
          <span>{{ data.checked ? "已授权" : "未授权" }}</span>
        </td>
      </tr>
    </tbody>
  </nz-table>
</div>